fix: remove output fields subsumed by primitiveVars to prevent duplic…#1948
fix: remove output fields subsumed by primitiveVars to prevent duplic…#1948NasserFlexCompute merged 3 commits intomainfrom
Conversation
…ate VTK DataArray names
When both "primitiveVars" and "pressure"/"velocity" are in outputFields,
the C++ FieldProcessor produces duplicate DataArray names ("p", "velocity")
in VTK output. This causes ParaView to fail when loading a subset of fields.
Strip "pressure" and "velocity" from the translated outputFields when
"primitiveVars" is already present, since primitiveVars expands to
rho + velocity + p in the solver.
Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Updates output-field translation to avoid duplicate VTK DataArray names when primitiveVars is selected alongside fields it already expands to (notably pressure/velocity), which can break ParaView loading.
Changes:
- Added
remove_fields_subsumed_by_primitive_vars()to strippressure/velocitywhenprimitiveVarsis present. - Applied this filter in
translate_output_fields()during solver JSON translation. - Added unit tests for the new filtering helper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
flow360/component/simulation/outputs/output_fields.py |
Introduces helper to remove fields subsumed by primitiveVars to prevent duplicate VTK arrays. |
flow360/component/simulation/translator/solver_translator.py |
Calls the new helper when translating non-volume output field lists. |
tests/simulation/outputs/test_output_fields.py |
Adds direct unit tests for the helper behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
translate_volume_output() builds outputFields independently of translate_output_fields(), so it was missing the remove_fields_subsumed_by_primitive_vars() call. Apply the same filter and update volume output translation test expectations. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ate VTK DataArray names
When both "primitiveVars" and "pressure"/"velocity" are in outputFields, the C++ FieldProcessor produces duplicate DataArray names ("p", "velocity") in VTK output. This causes ParaView to fail when loading a subset of fields.
Strip "pressure" and "velocity" from the translated outputFields when "primitiveVars" is already present, since primitiveVars expands to rho + velocity + p in the solver.
Made-with: Cursor
Note
Medium Risk
Changes solver JSON translation for
outputFieldsby removingpressure/velocitywhenprimitiveVarsis present, which could affect downstream expectations of exact field lists despite being redundant. Risk is limited to output configuration/VTK export behavior and covered by added/updated tests.Overview
Prevents duplicate VTK
DataArraynames by strippingpressureandvelocityfrom translatedoutputFieldswheneverprimitiveVarsis also requested (sinceprimitiveVarsalready expands torho,velocity, andp).Adds
remove_fields_subsumed_by_primitive_vars()inoutput_fields.pyand applies it during output-field translation insolver_translator.py, with new unit tests and updated translation expectations (notably removingvelocityfrom volume output cases that includeprimitiveVars).Written by Cursor Bugbot for commit 72998ad. This will update automatically on new commits. Configure here.